<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>List CAN channels</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="kvaser.gif"/></td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('page_example_c_channeldata.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">List CAN channels </div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p><b>samples\example\c\channeldata.c</b> </p><div class="fragment"><div class="line"><span class="comment">/*</span></div><div class="line"><span class="comment">**                   Copyright 2007-2016 by KVASER AB, SWEDEN</span></div><div class="line"><span class="comment">**                        WWW: http://www.kvaser.com</span></div><div class="line"><span class="comment">**</span></div><div class="line"><span class="comment">** This software is furnished under a license and may be used and copied</span></div><div class="line"><span class="comment">** only in accordance with the terms of such license.</span></div><div class="line"><span class="comment">**</span></div><div class="line"><span class="comment">** Description:</span></div><div class="line"><span class="comment">** This sample program enumerates all CAN channels in the computer and displays</span></div><div class="line"><span class="comment">** some information about them, such as hardware type, serial number, firmware revision.</span></div><div class="line"><span class="comment">** ---------------------------------------------------------------------------</span></div><div class="line"><span class="comment">*/</span></div><div class="line"><span class="preprocessor">#include &lt;stdlib.h&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;stdio.h&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;memory.h&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;windows.h&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;conio.h&gt;</span></div><div class="line"></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="canlib_8h.html">canlib.h</a>&gt;</span></div><div class="line"></div><div class="line"><span class="preprocessor">#ifdef __BORLANDC__</span></div><div class="line"><span class="preprocessor">#pragma argsused</span></div><div class="line"><span class="preprocessor">#endif</span></div><div class="line"></div><div class="line"></div><div class="line"><span class="keywordtype">char</span> CANCHANNEL_OPMODE_TEXT[5][20] = {<span class="stringliteral">&quot;Unknown&quot;</span>,<span class="stringliteral">&quot;None&quot;</span>,<span class="stringliteral">&quot;Infrastructure&quot;</span>,<span class="stringliteral">&quot;Reserved&quot;</span>,<span class="stringliteral">&quot;AdHoc&quot;</span>};</div><div class="line"></div><div class="line"></div><div class="line"><span class="keywordtype">void</span> Usage(<span class="keywordtype">int</span> argc, <span class="keywordtype">char</span>* argv[])</div><div class="line">{</div><div class="line">  printf(<span class="stringliteral">&quot;\nCANLIB Channel Enumeration &amp; Data\n&quot;</span>);</div><div class="line">  printf(<span class="stringliteral">&quot;\nA Part of the CANLIB SDK - see www.kvaser.com for more info.\n&quot;</span>);</div><div class="line">  printf(<span class="stringliteral">&quot;\n&quot;</span>);</div><div class="line">  printf(<span class="stringliteral">&quot;\nUsage: channeldata \n&quot;</span>);</div><div class="line"></div><div class="line">  exit(1);</div><div class="line">}</div><div class="line"></div><div class="line"></div><div class="line"><span class="keywordtype">void</span> Check(<span class="keywordtype">char</span>* <span class="keywordtype">id</span>, <a class="code" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7">canStatus</a> stat)</div><div class="line">{</div><div class="line">  <span class="keywordflow">if</span> (stat != <a class="code" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7a49743d0d438957118b9c6af2e831b209">canOK</a>) {</div><div class="line">    <span class="keywordtype">char</span> buf[50];</div><div class="line">    buf[0] = <span class="charliteral">&#39;\0&#39;</span>;</div><div class="line">    <a class="code" href="group__can__general.html#ga01a7a415c95c579750bcdd95a1d245c4">canGetErrorText</a>(stat, buf, <span class="keyword">sizeof</span>(buf));</div><div class="line">    printf(<span class="stringliteral">&quot;%s: failed, stat=%d (%s)\n&quot;</span>, <span class="keywordtype">id</span>, (<span class="keywordtype">int</span>)stat, buf);</div><div class="line">  }</div><div class="line">}</div><div class="line"></div><div class="line"><span class="keywordtype">void</span> main(<span class="keywordtype">int</span> argc, <span class="keywordtype">char</span>* argv[])</div><div class="line">{</div><div class="line">  <a class="code" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7">canStatus</a> stat;</div><div class="line">  <span class="keywordtype">int</span> i, chanCount;</div><div class="line"></div><div class="line">  printf(<span class="stringliteral">&quot;Starting...\n&quot;</span>);</div><div class="line"></div><div class="line">  <a class="code" href="group__can__general.html#gaff1ec1d3416d3bdd56336a7b9ac008b1">canInitializeLibrary</a>();</div><div class="line"></div><div class="line">  stat = <a class="code" href="group__can__general.html#ga65169ca633cd30aa92b8a80e28a5378b">canGetNumberOfChannels</a>(&amp;chanCount);</div><div class="line">  Check(<span class="stringliteral">&quot;canGetNumberOfChannels&quot;</span>, stat);</div><div class="line">  <span class="keywordflow">if</span> (chanCount&lt;0 || chanCount &gt; 1000) {</div><div class="line">    printf(<span class="stringliteral">&quot;ChannelCount = %d but I don&#39;t believe it.\n&quot;</span>, chanCount);</div><div class="line">    exit(1);</div><div class="line">  } <span class="keywordflow">else</span> {</div><div class="line">    printf(<span class="stringliteral">&quot;%d channels.\n&quot;</span>, chanCount);</div><div class="line">  }</div><div class="line"></div><div class="line">  <span class="keywordflow">for</span> (i=0; i&lt;chanCount; i++) {</div><div class="line">    <a class="code" href="linlib_8h.html#a798af1e30bc65f319c1a246cecf59e39">DWORD</a> tmp;</div><div class="line">    <a class="code" href="linlib_8h.html#a798af1e30bc65f319c1a246cecf59e39">DWORD</a> quad[2];</div><div class="line">    DWORD64 quad64[2];</div><div class="line">    <span class="keywordtype">char</span> name[64];</div><div class="line">    <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> ean[2];</div><div class="line">    <a class="code" href="canlib_8h.html#ae3d1b041d62207d5336f93c089cd5b65">canHandle</a> hnd;</div><div class="line">    <a class="code" href="linlib_8h.html#a798af1e30bc65f319c1a246cecf59e39">DWORD</a> flags;</div><div class="line">    <a class="code" href="linlib_8h.html#a798af1e30bc65f319c1a246cecf59e39">DWORD</a>  drivertype;</div><div class="line">    <span class="keywordtype">char</span> cust_channel_name[64];</div><div class="line"></div><div class="line">    printf(<span class="stringliteral">&quot;== Channel %d ===============================\n&quot;</span>, i);</div><div class="line"></div><div class="line">    stat = <a class="code" href="group__can__general.html#gab9552d1a588b0dbc144b097acba017b2">canGetChannelData</a>(i, <a class="code" href="canlib_8h.html#a7eeb70e7c666f629ca3762f4692469ae">canCHANNELDATA_CHANNEL_CAP</a>, &amp;tmp, <span class="keyword">sizeof</span>(tmp));</div><div class="line">    Check(<span class="stringliteral">&quot;canGetChannelData&quot;</span>, stat);</div><div class="line">    stat = <a class="code" href="group__can__general.html#gab9552d1a588b0dbc144b097acba017b2">canGetChannelData</a>(i, <a class="code" href="canlib_8h.html#ae8f3ade70e6718ccca7d914b251d0d2c">canCHANNELDATA_CHANNEL_CAP_EX</a>, &amp;quad64, <span class="keyword">sizeof</span>(quad64));</div><div class="line">    Check(<span class="stringliteral">&quot;canGetChannelData&quot;</span>, stat);</div><div class="line">    printf(<span class="stringliteral">&quot;Channel Capabilities Ex =  0x%I64x &quot;</span>, quad64[0]);</div><div class="line"></div><div class="line">    printf(<span class="stringliteral">&quot;Channel Capabilities =  0x%08lx &quot;</span>, tmp);</div><div class="line">    <span class="keywordflow">if</span> (tmp &amp; <a class="code" href="canlib_8h.html#aea4674f9e6857f681e911f638fd0c00e">canCHANNEL_CAP_EXTENDED_CAN</a>) printf(<span class="stringliteral">&quot;Ext &quot;</span>);</div><div class="line">    <span class="keywordflow">if</span> (tmp &amp; <a class="code" href="canlib_8h.html#a6657cafcf7b244917cc6e84a895e9bc9">canCHANNEL_CAP_BUS_STATISTICS</a>) printf(<span class="stringliteral">&quot;Stat &quot;</span>);</div><div class="line">    <span class="keywordflow">if</span> (tmp &amp; <a class="code" href="canlib_8h.html#a759fbc45e4c750b1753b1426526ebd4f">canCHANNEL_CAP_ERROR_COUNTERS</a>) printf(<span class="stringliteral">&quot;ErrCnt &quot;</span>);</div><div class="line">    <span class="keywordflow">if</span> (tmp &amp; <a class="code" href="obsolete_8h.html#a4867d2b7df8711010dd7f9441cbafa88">canCHANNEL_CAP_CAN_DIAGNOSTICS</a>) printf(<span class="stringliteral">&quot;Diag &quot;</span>);</div><div class="line">    <span class="keywordflow">if</span> (tmp &amp; <a class="code" href="canlib_8h.html#ac16175a4cc065c0836fa51f72831f399">canCHANNEL_CAP_GENERATE_ERROR</a>) printf(<span class="stringliteral">&quot;ErrGen &quot;</span>);</div><div class="line">    <span class="keywordflow">if</span> (tmp &amp; <a class="code" href="canlib_8h.html#a5139cc32d451a7f63c5a92692044396d">canCHANNEL_CAP_GENERATE_OVERLOAD</a>) printf(<span class="stringliteral">&quot;OvlGen &quot;</span>);</div><div class="line">    <span class="keywordflow">if</span> (tmp &amp; <a class="code" href="canlib_8h.html#af1a2f0419774877761035eb16441b406">canCHANNEL_CAP_TXREQUEST</a>) printf(<span class="stringliteral">&quot;TxRq &quot;</span>);</div><div class="line">    <span class="keywordflow">if</span> (tmp &amp; <a class="code" href="canlib_8h.html#a46307333df823ca35cf18a582a2fedb0">canCHANNEL_CAP_TXACKNOWLEDGE</a>) printf(<span class="stringliteral">&quot;TxAck &quot;</span>);</div><div class="line">    <span class="keywordflow">if</span> (tmp &amp; <a class="code" href="canlib_8h.html#a79e88cce2d07e78b482070824583e059">canCHANNEL_CAP_VIRTUAL</a>) printf(<span class="stringliteral">&quot;Virt &quot;</span>);</div><div class="line">    <span class="keywordflow">if</span> (tmp &amp; <a class="code" href="canlib_8h.html#a62edfa89566e668ea94fe669f3bedb74">canCHANNEL_CAP_SIMULATED</a>) printf(<span class="stringliteral">&quot;Simulated &quot;</span>);</div><div class="line">    <span class="keywordflow">if</span> (tmp &amp; <a class="code" href="obsolete_8h.html#a7748990724fd22b9be3cd02265358755">canCHANNEL_CAP_REMOTE</a>) printf(<span class="stringliteral">&quot;Remote &quot;</span>);</div><div class="line">    <span class="keywordflow">if</span> (tmp &amp; <a class="code" href="canlib_8h.html#af46aa24f177eabf4355d89a00fc0ffe4">canCHANNEL_CAP_CAN_FD</a>) printf(<span class="stringliteral">&quot;Fd &quot;</span>);</div><div class="line">    <span class="keywordflow">if</span> (tmp &amp; <a class="code" href="canlib_8h.html#a45e356713bd5b6f87d15966045a19f1c">canCHANNEL_CAP_CAN_FD_NONISO</a>) printf(<span class="stringliteral">&quot;Non-ISO &quot;</span>);</div><div class="line">    <span class="keywordflow">if</span> (tmp &amp; <a class="code" href="canlib_8h.html#af685c865f8ee78b5a2e5285bb57bd335">canCHANNEL_CAP_SILENT_MODE</a>) printf(<span class="stringliteral">&quot;Silent &quot;</span>);</div><div class="line">    <span class="keywordflow">if</span> (tmp &amp; <a class="code" href="canlib_8h.html#a80b4c1cf5b60fbed64a5ba220a5007ea">canCHANNEL_CAP_SINGLE_SHOT</a>) printf(<span class="stringliteral">&quot;Single-shot &quot;</span>);</div><div class="line">    <span class="keywordflow">if</span> (tmp &amp; <a class="code" href="canlib_8h.html#a8cc8a1a1960813e55b753943274d1006">canCHANNEL_CAP_CANTEGRITY</a>) printf(<span class="stringliteral">&quot;CANtegrity &quot;</span>);</div><div class="line">    <span class="keywordflow">if</span> (tmp &amp; <a class="code" href="canlib_8h.html#a116f1a9d0623257d2b1865669054d0b7">canCHANNEL_CAP_IO_API</a>) printf(<span class="stringliteral">&quot;IoApi &quot;</span>);</div><div class="line"></div><div class="line">    <span class="keywordflow">if</span> (quad64[0] &amp; <a class="code" href="canlib_8h.html#aeaa66fdba7afa78344fdebce758fd198">canCHANNEL_CAP_EX_BUSPARAMS_TQ</a>) printf (<span class="stringliteral">&quot;BusParamsTQ &quot;</span>);</div><div class="line">    printf(<span class="stringliteral">&quot;\n&quot;</span>);</div><div class="line"></div><div class="line">    stat = <a class="code" href="group__can__general.html#gab9552d1a588b0dbc144b097acba017b2">canGetChannelData</a>(i, <a class="code" href="canlib_8h.html#a1f5cac87fef63df18ea16825be85b672">canCHANNELDATA_TRANS_CAP</a>, &amp;tmp, <span class="keyword">sizeof</span>(tmp));</div><div class="line">    Check(<span class="stringliteral">&quot;canGetChannelData&quot;</span>, stat);</div><div class="line">    printf(<span class="stringliteral">&quot;DRVcan Capabilities =   0x%08lx &quot;</span>, tmp);</div><div class="line">    <span class="keywordflow">if</span> (tmp &amp; <a class="code" href="canlib_8h.html#aa48b4ac19c47428fa2b7754d7ee31513">canDRIVER_CAP_HIGHSPEED</a>) printf(<span class="stringliteral">&quot;HiSpd &quot;</span>);</div><div class="line">    printf(<span class="stringliteral">&quot;\n&quot;</span>);</div><div class="line"></div><div class="line">    stat = <a class="code" href="group__can__general.html#gab9552d1a588b0dbc144b097acba017b2">canGetChannelData</a>(i, <a class="code" href="canlib_8h.html#a9d7f6f8a7b736970d1d9c2ca28a5621e">canCHANNELDATA_CHANNEL_FLAGS</a>, &amp;tmp, <span class="keyword">sizeof</span>(tmp));</div><div class="line">    Check(<span class="stringliteral">&quot;canGetChannelData&quot;</span>, stat);</div><div class="line">    printf(<span class="stringliteral">&quot;Channel Flags =         0x%08lx &quot;</span>, tmp);</div><div class="line">    <span class="keywordflow">if</span> (tmp &amp; <a class="code" href="canlib_8h.html#a5ef61941ff31a5a9bcae650154b114c2">canCHANNEL_IS_OPEN</a>)  printf(<span class="stringliteral">&quot;Open &quot;</span>);</div><div class="line">    <span class="keywordflow">if</span> (tmp &amp; <a class="code" href="canlib_8h.html#a0a5e8cfce34215be4a0bca2a468853ab">canCHANNEL_IS_CANFD</a>) printf(<span class="stringliteral">&quot;as canFD &quot;</span>);</div><div class="line">    printf(<span class="stringliteral">&quot;\n&quot;</span>);</div><div class="line">    </div><div class="line">    <span class="keywordflow">if</span> (tmp &amp; canCHANNEL_IS_CANFD)</div><div class="line">      hnd = <a class="code" href="group___c_a_n.html#gac377d182232fb4ec2fed881c2b9ab300">canOpenChannel</a>(i, <a class="code" href="canlib_8h.html#a1d7dee5873b91fc267239dfaedf977df">canOPEN_NO_INIT_ACCESS</a> + <a class="code" href="canlib_8h.html#afa69f658ed251fbaef6382127c23b7fb">canOPEN_OVERRIDE_EXCLUSIVE</a> + <a class="code" href="canlib_8h.html#a8e4ead14e67e49e27674c706e0d88f23">canOPEN_ACCEPT_VIRTUAL</a> + <a class="code" href="canlib_8h.html#a10aad075bfb9891aa98cf3c131977dc3">canOPEN_CAN_FD</a>);</div><div class="line">    <span class="keywordflow">else</span></div><div class="line">      hnd = <a class="code" href="group___c_a_n.html#gac377d182232fb4ec2fed881c2b9ab300">canOpenChannel</a>(i, <a class="code" href="canlib_8h.html#a1d7dee5873b91fc267239dfaedf977df">canOPEN_NO_INIT_ACCESS</a> + <a class="code" href="canlib_8h.html#afa69f658ed251fbaef6382127c23b7fb">canOPEN_OVERRIDE_EXCLUSIVE</a> + <a class="code" href="canlib_8h.html#a8e4ead14e67e49e27674c706e0d88f23">canOPEN_ACCEPT_VIRTUAL</a>);</div><div class="line"></div><div class="line">    stat = <a class="code" href="group___c_a_n.html#gaca3da209fe673b3838a50a3abe831855">canReadStatus</a>(hnd, &amp;flags);</div><div class="line">    Check(<span class="stringliteral">&quot;canReadStatus&quot;</span>, stat);</div><div class="line">    printf(<span class="stringliteral">&quot;Channel Status Flags =  0x%08lx &quot;</span>, flags);</div><div class="line">    <span class="keywordflow">if</span> (flags &amp; <a class="code" href="canstat_8h.html#aab3d45d8b4e8bfbba45d585fb6195fbf">canSTAT_BUS_OFF</a>) printf(<span class="stringliteral">&quot;BusOff &quot;</span>);</div><div class="line">    printf(<span class="stringliteral">&quot;\n&quot;</span>);</div><div class="line"></div><div class="line">    stat = <a class="code" href="group___c_a_n.html#ga1683419d56af8afdbfc9184678c82fdd">canGetBusOutputControl</a>(hnd, &amp;drivertype);</div><div class="line">    Check(<span class="stringliteral">&quot;canGetBusOutputControl&quot;</span>, stat);</div><div class="line">    printf(<span class="stringliteral">&quot;Drivertype =            0x%08lx &quot;</span>, drivertype);</div><div class="line">    <a class="code" href="group___c_a_n.html#ga49525373a4d08d93c651ec10f79dd36b">canClose</a>(hnd);</div><div class="line">    <span class="keywordflow">if</span> (drivertype &amp; <a class="code" href="canlib_8h.html#ab82a818e60cddf4c65c54d42a474a023">canDRIVER_SILENT</a>) </div><div class="line">      printf(<span class="stringliteral">&quot;Silent &quot;</span>);</div><div class="line">    <span class="keywordflow">else</span></div><div class="line">      printf(<span class="stringliteral">&quot;Normal &quot;</span>);</div><div class="line">    printf(<span class="stringliteral">&quot;\n&quot;</span>);</div><div class="line">    </div><div class="line">    stat = <a class="code" href="group__can__general.html#gab9552d1a588b0dbc144b097acba017b2">canGetChannelData</a>(i, <a class="code" href="canlib_8h.html#ab47621a7326e1da3427db331ec9afdee">canCHANNELDATA_BUS_TYPE</a>, &amp;tmp, <span class="keyword">sizeof</span>(tmp));</div><div class="line">    Check(<span class="stringliteral">&quot;canCHANNELDATA_BUS_TYPE&quot;</span>, stat);</div><div class="line">    printf(<span class="stringliteral">&quot;Bustype      =          0x%08lx\n&quot;</span>, tmp);</div><div class="line"></div><div class="line">    stat = <a class="code" href="group__can__general.html#gab9552d1a588b0dbc144b097acba017b2">canGetChannelData</a>(i, <a class="code" href="canlib_8h.html#a9b87ca5dae3a435aed11a7aa4f2c2000">canCHANNELDATA_CARD_NUMBER</a>, &amp;tmp, <span class="keyword">sizeof</span>(tmp));</div><div class="line">    Check(<span class="stringliteral">&quot;canCHANNELDATA_CARD_NUMBER&quot;</span>, stat);</div><div class="line">    printf(<span class="stringliteral">&quot;Board Number =          0x%08lx\n&quot;</span>, tmp);</div><div class="line"></div><div class="line">    stat = <a class="code" href="group__can__general.html#gab9552d1a588b0dbc144b097acba017b2">canGetChannelData</a>(i, <a class="code" href="canlib_8h.html#a4e0823a649d26191cde50f2c4fa5a65d">canCHANNELDATA_CHAN_NO_ON_CARD</a>, &amp;tmp, <span class="keyword">sizeof</span>(tmp));</div><div class="line">    Check(<span class="stringliteral">&quot;canCHANNELDATA_CHAN_NO_ON_CARD&quot;</span>, stat);</div><div class="line">    printf(<span class="stringliteral">&quot;Channel no on board =   0x%08lx\n&quot;</span>, tmp);</div><div class="line"></div><div class="line">    stat = <a class="code" href="group__can__general.html#gab9552d1a588b0dbc144b097acba017b2">canGetChannelData</a>(i, <a class="code" href="canlib_8h.html#a8b3b4903a766565c95afd7c90f76d994">canCHANNELDATA_CARD_SERIAL_NO</a>, quad, <span class="keyword">sizeof</span>(quad));</div><div class="line">    Check(<span class="stringliteral">&quot;canCHANNELDATA_CARD_SERIAL_NO&quot;</span>, stat);</div><div class="line">    printf(<span class="stringliteral">&quot;Board S/N =             0x%08lx 0x%08lx\n&quot;</span>, quad[0], quad[1]);</div><div class="line"></div><div class="line">    stat = <a class="code" href="group__can__general.html#gab9552d1a588b0dbc144b097acba017b2">canGetChannelData</a>(i, <a class="code" href="canlib_8h.html#aba2148fef4de2c724510cead2edd4060">canCHANNELDATA_TRANS_SERIAL_NO</a>, quad, <span class="keyword">sizeof</span>(quad));</div><div class="line">    Check(<span class="stringliteral">&quot;canCHANNELDATA_TRANS_SERIAL_NO&quot;</span>, stat);</div><div class="line">    printf(<span class="stringliteral">&quot;DRVcan S/N =            0x%08lx 0x%08lx\n&quot;</span>, quad[0], quad[1]);</div><div class="line"></div><div class="line">    stat = <a class="code" href="group__can__general.html#gab9552d1a588b0dbc144b097acba017b2">canGetChannelData</a>(i, <a class="code" href="canlib_8h.html#a1ab7e59c0771f2f9850e8fe1d2d58ff1">canCHANNELDATA_CARD_FIRMWARE_REV</a>, quad, <span class="keyword">sizeof</span>(quad));</div><div class="line">    Check(<span class="stringliteral">&quot;canCHANNELDATA_CARD_FIRMWARE_REV&quot;</span>, stat);</div><div class="line">    printf(<span class="stringliteral">&quot;Board F/W version =     0x%08lx 0x%08lx\n&quot;</span>, quad[0], quad[1]);</div><div class="line"></div><div class="line">    stat = <a class="code" href="group__can__general.html#gab9552d1a588b0dbc144b097acba017b2">canGetChannelData</a>(i, <a class="code" href="canlib_8h.html#a78c72932de87adc579871b797817fa7c">canCHANNELDATA_CARD_HARDWARE_REV</a>, quad, <span class="keyword">sizeof</span>(quad));</div><div class="line">    Check(<span class="stringliteral">&quot;canCHANNELDATA_CARD_HARDWARE_REV&quot;</span>, stat);</div><div class="line">    printf(<span class="stringliteral">&quot;Board H/W version =     0x%08lx 0x%08lx\n&quot;</span>, quad[0], quad[1]);</div><div class="line"></div><div class="line">    stat = <a class="code" href="group__can__general.html#gab9552d1a588b0dbc144b097acba017b2">canGetChannelData</a>(i, <a class="code" href="canlib_8h.html#a9062beaa59d9787667bac6cbbc6b4e20">canCHANNELDATA_CARD_UPC_NO</a>, ean, <span class="keyword">sizeof</span>(ean));</div><div class="line">    Check(<span class="stringliteral">&quot;canCHANNELDATA_CARD_UPC_NO&quot;</span>, stat);</div><div class="line">    printf(<span class="stringliteral">&quot;Board UPC/EAN =         0x%08lx 0x%08lx\n&quot;</span>, ean[1], ean[0]);</div><div class="line"></div><div class="line">    stat = <a class="code" href="group__can__general.html#gab9552d1a588b0dbc144b097acba017b2">canGetChannelData</a>(i, <a class="code" href="canlib_8h.html#aad2e8c543a764838c962947914c6e3a2">canCHANNELDATA_TRANS_UPC_NO</a>, ean, <span class="keyword">sizeof</span>(ean));</div><div class="line">    Check(<span class="stringliteral">&quot;canCHANNELDATA_TRANS_UPC_NO&quot;</span>, stat);</div><div class="line">    printf(<span class="stringliteral">&quot;DRVcan UPC/EAN =        0x%08lx 0x%08lx\n&quot;</span>, ean[1], ean[0]);</div><div class="line"></div><div class="line">    stat = <a class="code" href="group__can__general.html#gab9552d1a588b0dbc144b097acba017b2">canGetChannelData</a>(i, <a class="code" href="canlib_8h.html#aa4fc3066c84e718b90e870103837259b">canCHANNELDATA_CHANNEL_NAME</a>, name, <span class="keyword">sizeof</span>(name));</div><div class="line">    Check(<span class="stringliteral">&quot;canCHANNELDATA_CHANNEL_NAME&quot;</span>, stat);</div><div class="line">    printf(<span class="stringliteral">&quot;Channel name =          &#39;%s&#39;\n&quot;</span>, name);</div><div class="line"></div><div class="line">    stat = <a class="code" href="group__can__general.html#gab9552d1a588b0dbc144b097acba017b2">canGetChannelData</a>(i, <a class="code" href="canlib_8h.html#a0e91dd0d999b3043c6da5cb911dd83d8">canCHANNELDATA_CUST_CHANNEL_NAME</a>, cust_channel_name, </div><div class="line">                             <span class="keyword">sizeof</span>(cust_channel_name));</div><div class="line">    <span class="keywordflow">if</span> (stat == <a class="code" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7a49743d0d438957118b9c6af2e831b209">canOK</a>) {</div><div class="line">      printf(<span class="stringliteral">&quot;Cust. Channel name =    &#39;%s&#39;\n&quot;</span>, cust_channel_name);</div><div class="line">    }</div><div class="line"></div><div class="line">    stat = <a class="code" href="group__can__general.html#gab9552d1a588b0dbc144b097acba017b2">canGetChannelData</a>(i, <a class="code" href="canlib_8h.html#a329cc65b32c3bfa8b5057db0782c914f">canCHANNELDATA_REMOTE_OPERATIONAL_MODE</a>, &amp;tmp, <span class="keyword">sizeof</span>(tmp));</div><div class="line">    <span class="keywordflow">if</span> ((stat != <a class="code" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7a41e892edb8f1b6f9f609599df8e20bdf">canERR_NOT_IMPLEMENTED</a>) &amp;&amp; (stat != <a class="code" href="canstat_8h.html#a52b5e5c71832b0bd3c6a5b1fd48583e7a632ad377bdda7890936099a9c48fb1bd">canERR_HARDWARE</a>)) {</div><div class="line">      Check(<span class="stringliteral">&quot;canCHANNELDATA_REMOTE_OPERATIONAL_MODE&quot;</span>, stat);</div><div class="line">      printf(<span class="stringliteral">&quot;Operational mode =      %lu (%s)\n&quot;</span>, tmp, CANCHANNEL_OPMODE_TEXT[tmp]);</div><div class="line"></div><div class="line">      stat = <a class="code" href="group__can__general.html#gab9552d1a588b0dbc144b097acba017b2">canGetChannelData</a>(i, <a class="code" href="canlib_8h.html#a35149bdcf36515f1dc329b25e77d6072">canCHANNELDATA_REMOTE_PROFILE_NAME</a>, name, <span class="keyword">sizeof</span>(name));</div><div class="line">      Check(<span class="stringliteral">&quot;canCHANNELDATA_REMOTE_PROFILE_NAME&quot;</span>, stat);</div><div class="line">      printf(<span class="stringliteral">&quot;Profile name =          &#39;%s&#39;\n&quot;</span>, name);</div><div class="line"></div><div class="line">      stat = <a class="code" href="group__can__general.html#gab9552d1a588b0dbc144b097acba017b2">canGetChannelData</a>(i, <a class="code" href="canlib_8h.html#a88a81aaeb5efbe8dc84d8b5385175e56">canCHANNELDATA_REMOTE_HOST_NAME</a>, name, <span class="keyword">sizeof</span>(name));</div><div class="line">      Check(<span class="stringliteral">&quot;canCHANNELDATA_REMOTE_HOST_NAME&quot;</span>, stat);</div><div class="line">      printf(<span class="stringliteral">&quot;Remote host name =      &#39;%s&#39;\n&quot;</span>, name);</div><div class="line"></div><div class="line">      stat = <a class="code" href="group__can__general.html#gab9552d1a588b0dbc144b097acba017b2">canGetChannelData</a>(i, <a class="code" href="canlib_8h.html#a2777677d94f63434f83da6e587a9db17">canCHANNELDATA_REMOTE_MAC</a>, name, <span class="keyword">sizeof</span>(name));</div><div class="line">      Check(<span class="stringliteral">&quot;canCHANNELDATA_REMOTE_MAC&quot;</span>, stat);</div><div class="line">      printf(<span class="stringliteral">&quot;MAC =                   &#39;%s&#39;\n&quot;</span>, name);</div><div class="line">    } <span class="keywordflow">else</span> {</div><div class="line">      printf(<span class="stringliteral">&quot;Device is not capable of acting in remote operational mode\n&quot;</span>);</div><div class="line">    }   </div><div class="line">    </div><div class="line">    printf(<span class="stringliteral">&quot;\n&quot;</span>);</div><div class="line">  }</div><div class="line">}</div></div><!-- fragment --> </div></div><!-- contents -->
</div><!-- doc-content -->
<!-- HTML footer for doxygen 1.8.13-->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="page_canlib.html">CAN bus API (CANlib)</a></li><li class="navelem"><a class="el" href="page_user_guide_canlib_samples.html">Sample Programs (CANlib)</a></li>
    <li class="footer"> (canlib 5.38) Tue Feb 15 2022</li>
  </ul>
</div>
</body>
</html>
